package com.finger.gulimall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.finger.common.utils.PageUtils;
import com.finger.gulimall.product.entity.SkuInfoEntity;
import com.finger.gulimall.product.vo.SkuInfoVo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * sku信息
 *
 * @author finger
 * @email 909128695@qq.com
 * @date 2022-03-16 12:43:42
 */
public interface SkuInfoService extends IService<SkuInfoEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 分页查询带条件
     *
     * @param params
     * @return
     */
    PageUtils queryPageCondition(Map<String, Object> params);

    /**
     * 根据skuid获取spu的全部信息
     *
     * @param spuId 商品id
     * @return
     */
    List<SkuInfoEntity> getSkuBySpuId(Long spuId);

    /**
     * 根据skuId检索商品详情
     *
     * @param skuId
     * @return
     */
    SkuInfoVo item(Long skuId) throws ExecutionException, InterruptedException;

    /**
     * 根据商品id查询商品最新价格
     * @param skus
     * @return
     */
    Map<Long, BigDecimal> getNewItemPriceForCart(List<Long> skus);
}

